<?php TPL::output('mobile/header.tpl.htm'); ?>

<div class="sort">
	<div class="newsort">
		<span class="pic"></span><?php if ($this->category_info) { ?><?php echo $this->category_info['title']; ?><?php } else if ($this->feature_info) { ?><?php echo $this->feature_info['title']; ?><?php } else { ?>全部站点<?php } ?>

<?php if($this->content_category){ ?>
        <div class="sort_c"><div class="btn">&nbsp;&nbsp;分类</div>
         <div class="picsort">
    	<ul><a href="mobile/explore/"><div  class="sort_all">全部</div></a>
    	    <?php foreach ($this->content_category as $key => $val) { ?>
    	    	<a href="mobile/explore/category-<?php echo $val['id']; ?>"><li<?php if ($_GET['category'] AND ($val['id'] == $this->category_info['id'] OR $this->category_info['parent_id'] == $val['id'])) { ?> class="cur"<?php } ?>><img src="<?php echo $val['icon']; ?>" title="<?php echo $val['title']; ?>" alt="" width="25" height="25" /> <?php echo $val['title']; ?></li></a>
    	    <?php } ?>
        </ul>
        <div style="clear:both;"></div>
    </div>
                     
        </div>
<?php } ?>

	</div>
    
    <?php if ($this->content_category) { ?>
   
    <?php } ?>
    
    <div class="sort_class"  >
    	<div style=" text-align:center;">    		
    		<a href="mobile/explore/sort_type-new__<?php if ($_GET['category']) { ?>__category-<?php echo $_GET['category']; ?><?php } ?>" <?php if (!$_GET['sort_type'] OR $_GET['sort_type'] == 'new') { ?> class="cur"<?php } ?>>最新</a> • 
    		<a href="mobile/explore/sort_type-hot____day-7<?php if ($_GET['category']) { ?>__category-<?php echo $_GET['category']; ?><?php } ?>" id="sort_control_hot" <?php if ($_GET['sort_type'] == 'hot') { ?> class="cur"<?php } ?>>热门</a> • <a href="mobile/explore/sort_type-unresponsive__<?php if ($_GET['category']) { ?>__category-<?php echo $_GET['category']; ?><?php } ?>" <?php if ($_GET['sort_type'] == 'unresponsive') { ?> class="cur"<?php } ?>>待评价</a>
            
    	</div>
    	
    </div>
 
    
    <div class="con"  style="border-top:#E6E6E6 1px solid; ">
    	<ul id="question_list">
	    	<?php echo $this->question_list_bit; ?>
	    </ul>
    	
	    <div class="more" id="mobile_more">更多</div>
    </div>
</div>

<script type="text/javascript">
var cur_day = 30;
var cur_sort_type = 'new';
var cur_category_id = '';
var cur_load_page = 1;

function reloadSortList(el, sort_type, category_id, day)
{
	if (category_id)
	{
		cur_category_id = category_id;
	}
	
	if (sort_type)
	{
		cur_page = 0;
		cur_load_page = 0;
		cur_sort_type = sort_type;
		
		$('#sort_control a').removeClass();
		
		if (sort_type == 'hot')
		{
			$('#sort_control_hot').addClass('cur');
		}
	}
	
	cur_day = 0;
	
	if (day)
	{
		cur_day = day;
	}
	
	if (el)
	{
		$(el).addClass('cur');
	}
	
	mobile_more_load(G_BASE_URL + '/question/ajax/discuss/template-mobile__sort_type-' + cur_sort_type + '__category-' + cur_category_id + '__day-' + cur_day, $('#mobile_more'), $('#question_list'), 1);
}

$(document).ready(function()
{
	if ($('#question_list').html() == '')
	{
		$('#question_list').html('<p style="padding: 15px 0" align="center">没有内容</p>');
		$('#mobile_more').addClass('disabled');
		$('#mobile_more').html('没有更多了');
	}
	
	mobile_more_load(G_BASE_URL + '/question/ajax/discuss/template-mobile__sort_type-' + cur_sort_type + '__category-' + cur_category_id + '__day-' + cur_day, $('#mobile_more'), $('#question_list'), 1);
});
</script>

<?php if ($_GET['sort_type']) { ?>
<script type="text/javascript">cur_sort_type = '<?php echo $_GET['sort_type']; ?>';</script>
<?php } ?>
<?php if ($_GET['day']) { ?>
<script type="text/javascript">cur_day = <?php echo intval($_GET['day']); ?>;</script>
<?php } ?>
<?php if ($_GET['category']) { ?>
<script type="text/javascript">cur_category_id = <?php echo intval($_GET['category']); ?>;</script>
<?php } ?>

<?php TPL::output('mobile/footer.tpl.htm'); ?>